<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<div class="bjui-pageContent" style="top: 0px; bottom: 32px;">
    <form id="change_password_form_id" method="post" action="/admin/operator/changePwd">
        <div class="bjui-row col-2">
            <input type="hidden" name="id" value="${id}">
            <%--<p>
                <label class="row-label">原密码</label>
                <span class="datagrid-dialog-column-span">
                    <input type="password" name="password" value="" data-rule="required">
                </span>
            </p>--%>

            <p>
                <label class="row-label">新密码</label>
                <span class="datagrid-dialog-column-span">
                    <input type="password" name="newPassword" value="" data-rule="required">
                </span>
            </p>

            <p>
                <label class="row-label">再次输入</label>
                <span class="datagrid-dialog-column-span">
                    <input type="password" name="confirmPassword" value="" data-rule="required">
                </span>
            </p>
        </div>
    </form>
</div>
<div class="bjui-pageFooter">
    <ul>
        <li>
            <button type="button" class="btn btn-red cancel" onclick="BJUI.dialog('closeCurrent');" data-icon="remove">
                <i class="fa fa-remove"></i> 取消
            </button>
        </li>
        <li>
            <button type="button" class="btn btn-default save" onclick="doRoleSave();" data-icon="save"><i class="fa fa-save"></i> 保存</button>
        </li>
    </ul>
</div>
<script>

    /**
     * 提交保存信息
     */
    function doRoleSave() {
        BJUI.ajax('ajaxform', {
            url: '/admin/operator/changePwd',
            form: $("#change_password_form_id"),
            validate: true,
            loadingmask: true,
            callback: function (response, options) {
                BJUI.dialog('closeCurrent');
                if (response.haveError) {
                    BJUI.alertmsg('error', response.errMsg, {
                        okCall: function () {
                            $('#operator_table').datagrid("refresh",true);
                        }
                    });

                } else {
                    BJUI.alertmsg('ok', response.data, {
                        okCall: function () {
                            $('#operator_table').datagrid("refresh",true);
                        }
                    });
                }
            }
        });
    }
</script>